home *** CD-ROM | disk | FTP | other *** search
- class Puddle
- {
- var pos;
- var type;
- var mcPuddle;
- var delay;
- function Puddle(posNew, typeNew, mcCanvas)
- {
- this.pos = posNew.clone();
- this.type = typeNew;
- var _loc2_ = undefined;
- if(this.type == 0)
- {
- _loc2_ = "oil";
- }
- else if(this.type == 1)
- {
- _loc2_ = "water";
- }
- this.mcPuddle = mcCanvas.attachMovie(_loc2_,"mcPuddle",5,{_alpha:60});
- var _loc3_ = !Application.bEasy ? 10 : 8;
- this.delay = 150 - Game.level * _loc3_ + Math.round(30 * Math.random());
- }
- function step(plVel)
- {
- this.pos.y -= plVel.y;
- this.checkBottom();
- }
- function draw()
- {
- this.mcPuddle._x = this.pos.x;
- this.mcPuddle._y = Game.screenH - this.pos.y;
- }
- function remove(Void)
- {
- this.mcPuddle.removeMovieClip();
- false;
- }
- function checkBottom(Void)
- {
- if(this.pos.y < -50)
- {
- this.pos.y = -55;
- if(this.delay-- <= 0)
- {
- Game.getInstance().removePuddle(this);
- }
- }
- }
- }
-